package main

import "fmt"

type Cat struct {
	//性别
	gender int
	color  string
	name   string
}

// 构造函数
func newCat(gender int, color string, name string) *Cat {
	return &Cat{
		gender: gender,
		color:  color,
		name:   name}
}

// 吃饭
// 吃饭
func (catInstance Cat) eat(food string) {
	fmt.Println(catInstance.name, "正在吃：", food)
}

// 睡觉
func (catInstance Cat) dream() {
	fmt.Println(catInstance.name, "睡得很香")
}

// 喵喵叫
func (catInstance Cat) newing() {
	fmt.Println(catInstance.name, "喵喵喵")
}

// 修改名字
func (catInstance *Cat) rename(newName string) {
	catInstance.name = newName
	fmt.Println("方法中catInstance的name属性值为", catInstance.name)
}

type MyString string

func (name MyString) shoAmi() {
	fmt.Println("我的名字:", name)
}

func main() {
	//通过newCat()函数生成Cat结构
}
